package cn.tedu.orderservice.mapper;

import cn.tedu.orderservice.pojo.po.ChargingBillFailPO;
import cn.tedu.orderservice.pojo.po.ChargingBillSuccessPO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

public interface OrderMapper extends BaseMapper<ChargingBillSuccessPO> {
    /**
     * 保存成功订单
     * @param chargingBillSuccessPO
     */
    void saveSuccessful(ChargingBillSuccessPO chargingBillSuccessPO);

    /**
     * 保存失败订单
     * @param chargingBillFailPO
     */
    void saveFailed(ChargingBillFailPO chargingBillFailPO);

    /**
     * 更新异常状态
     * @param chargingBillSuccessPO
     */
    void updateStatusNormalToException(ChargingBillSuccessPO chargingBillSuccessPO);

    /**
     * 查询成功订单
     * @param billId
     * @return
     */
    ChargingBillSuccessPO getSuccess(String billId);

    /**
     * 查询失败订单
     * @param billId
     * @return
     */
    ChargingBillFailPO getFail(String billId);

    /**
     * 更新成功订单详情信息
     * @param billId
     * @param gunId
     */
    void updateSuccessOrder(@Param("billId") String billId,@Param("gunId") Long gunId);

    /**
     * 用户正常结束订单
     * @param chargingBillSuccessPO
     */
    void updateStatus2NormalStop(ChargingBillSuccessPO chargingBillSuccessPO);
}
